package com.orangelife.mobile.main.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.curry.android.util.IntentHelper;
import com.curry.orangelife.mobile.R;
import com.datatrack.DataTrack;
import com.orangelife.mobile.common.activity.OrangeLifeBaseActivity;
import com.orangelife.mobile.myhouse.activity.HouseCertActivity;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by luxiaojuan
 * on 2015/11/19.
 */
public class ApplyCertActivity extends OrangeLifeBaseActivity {

    @Bind(R.id.tv_title)
    TextView tvTitle;
    @Bind(R.id.tvApplyHint)
    TextView tvApplyHint;
    @Bind(R.id.btnApplyCert)
    Button btnApplyCert;
    /**Activit 名称**/
    final  String MODULE_NAME="paymentOrder";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_apply_cert);

        ButterKnife.bind(this);
        initView();
        findView();
    }

    private void initView() {
        Intent data = getIntent();
        String title = data.getStringExtra("title");
        String hint = data.getStringExtra("hint");
        tvTitle.setText(title);
        tvApplyHint.setText(hint);
        btnApplyCert.setText("申请认证");

    }

    private void findView() {
        btnApplyCert.setOnClickListener(listener);
    }

    /**
     * 设置监听器
     */
    private View.OnClickListener listener = new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            String type="0";
            if(getIntent().getStringExtra("title").equals("投诉建议")){
                type="1";
            }
            DataTrack.clickTrack(DataTrack.APP_NAME,MODULE_NAME,"applyAuthentication");
            IntentHelper.getInstances().intentWithExtra(ApplyCertActivity.this, HouseCertActivity.class,"intentType",type);//0物业报修1投诉建议
            finish();
        }
    };


}
